package com.bean;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
 * <br>本机IP，默认含标准主机名
 * @author wsq
 */
public class ComputerSelf {
	public ComputerSelf() {
		super();
		this.ipSet = new HashSet<>();
		this.ipSet.add("localhost");
		this.mySelfDefault = new Computer(0, "localhost", "", "localhost");
	}
	
	int id=0;
	Computer mySelfDefault;
	/*
	 * <br>IP配置类
	 */
	Map<Integer, Computer> other = new HashMap<>();
	/*
	 * <br>IP集合
	 */
	Set<String> ipSet;
	/*
	 * <br>已经使用的端口号
	 */
	Set<Integer> portSet = new HashSet<>();
	
	public void setPortSet(Set<Integer> portSet) {
		if (null!= portSet) {
			this.portSet = portSet;
		}
	}
	public void setIpSet(Set<String> ipSet) {
		if (null!= ipSet) {
			this.ipSet = ipSet;
		}
	}
	public void setOther(Map<Integer, Computer> other) {
		if (null!= other) {
			this.other = other;
		}
	}
	public int nextId() {
		this.id -= 1;
		return this.id;
	}
	public Computer getMySelfDefault() {
		return mySelfDefault;
	}
	public Set<String> getIpSet() {
		return ipSet;
	}
	public Map<Integer, Computer> getOther() {
		return other;
	}
	public Set<Integer> getPortSet() {
		return portSet;
	}
}
